import csv
from conf.setting import DIR_PATH
from common.recordlog import logs
import os

def read_csv_data(file_name):
    """
    读取csv文件的数据
    :param file_name:读取数据文件
    """
    try:
        with open(os.path.join(DIR_PATH,'data',file_name),'r',encoding='utf-8')as f:
            csv_reader=csv.reader(f)
            return list(csv_reader)
    except  Exception as e:
        logs.error(e)


if __name__ == '__main__':
    print(read_csv_data('test_data.csv'))